<template>
  <div class="content-body">
    <el-row>
      <el-col :span="24">
        <div class="content-handle">
          <h2 class="title">Dash board</h2>
          <div class="right">
            <el-button icon="arrow-right">mqTrigger</el-button>
            <el-button icon="arrow-right">timeTrigger</el-button>
          </div>
        </div>
      </el-col>
    </el-row>
    <data-grid title="Task List" url="/api/taskList" dataName="formData">
      <!--form-->
      <template slot="form">
        <el-form-item label="bizType">
          <el-select v-model="formData.bizType" filterable placeholder="select please...">
            <el-option
              v-for="bizType in bizTypeList"
              :key="bizType.value"
              :label="bizType.label"
              :value="bizType.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="id">
          <el-input v-model="formData.id">
          </el-input>
        </el-form-item>
        <el-form-item label="title(KeyWord)">
          <el-input v-model="formData.title_LK">
          </el-input>
        </el-form-item>
        <el-form-item label="beginTime">
          <el-date-picker
            v-model="formData.beginTime_RANG"
            type="datetimerange"
            align="right">
          </el-date-picker>
        </el-form-item>
      </template>
      <!--tabs-->
      <template slot="tabs">
        <el-tabs v-model="formData.status">
          <el-tab-pane label="trigger" name="0"></el-tab-pane>
          <el-tab-pane label="takeData" name="10"></el-tab-pane>
          <el-tab-pane label="collCheck" name="20"></el-tab-pane>
          <el-tab-pane label="handleData" name="30"></el-tab-pane>
          <el-tab-pane label="ending" name="40"></el-tab-pane>
          <el-tab-pane label="failure" name="99"></el-tab-pane>
          <el-tab-pane label="succeed" name="100"></el-tab-pane>
        </el-tabs>
      </template>
      <!--body-->
      <template slot="body">
        <el-table-column
          prop="date"
          label="date">
        </el-table-column>
        <el-table-column
          prop="name"
          label="name">
        </el-table-column>
        <el-table-column
          prop="address"
          label="address">
        </el-table-column>
      </template>
    </data-grid>
  </div>
</template>

<script>
  import DataGrid from "./plugins/DataGrid";
  export default {
    components: {
      DataGrid},
    name: 'Dashboard',
    data() {
      return {
        "bizTypeList":[],
        "formData":{
          "bizType":"",
          "beginTime_RANG":""
        }
      }
    },
    created: function() {
      var that = this;
      this.axios.get('/api/bizTypeList')
        .then(function (response) {
          that.bizTypeList = response.data.dataList;
        });
    }
  }
</script>
